-- @owner: zou_jialiang050
-- @date: 2024/4/2
-- @testpoint: pipelined函数返回关联数组类型,部分测试点合理报错

--step1:创建关联数组类型;expect:成功
create or replace type associative_array_0007 as(key text, value text);

--step2:创建管道函数并查看返回值;expect:失败
create or replace function func_pipelined_007_1(count in number)
returns associative_array_0007 pipelined
as $$
declare result associative_array_0007;
begin
for i in 1 .. count loop
result := array[row('name', 'asdf'), row('age', '14')];
pipe row(result);
end loop;
return;
end;
$$ language plpgsql;
/

--step2:清理环境;expect:成功
drop type if exists associative_array_0007 cascade;
drop function if exists func_pipelined_007;
